import 'package:test/entities/user.dart';
import 'package:test/network/request.dart';

class UserApi {

  static Future<User> getUser() async {
    try {
      final response = await Request.get('/getUser');
      return User.fromJson(response.data);
    } catch (e) {
      throw e;
    }
  }

  static Future<User> login() async {
    try {
      final response = await Request.get('/login');
      return User.fromJson(response.data);
    } catch (e) {
      throw e;
    }
  }
}